package org.vic.strategy.demo03;

/**
 * Created by VIC.Huang on 2016/8/24.
 */
public class CalPriceFactory {
    private CalPriceFactory(){}

    // 根据客户的总金额产生对应的价格计算策略
    public static CalPrice createCalPrice(Customer customer) {
        if(customer.getTotalAmount() > 3000) {
            return new DiffType4CalPrice().new GoldVip();
        }else if(customer.getTotalAmount() > 2000) {
            return new DiffType4CalPrice().new SuperVip();
        }else if(customer.getTotalAmount() > 1000) {
            return new DiffType4CalPrice().new Vip();
        }
        return null;
    }
}
